import { Result, Button } from 'antd'
import { useNavigate } from 'react-router-dom'
import { HomeOutlined, LoginOutlined } from '@ant-design/icons'
import './AdminNotFound.css'

export default function AdminNotFound() {
    const navigate = useNavigate()

    const handleBackToDashboard = () => {
        navigate('/admin/dashboard')
    }

    const handleBackToLogin = () => {
        navigate('/admin/login')
    }

    return (
        <div className="admin-not-found">
            <Result
                status="404"
                title="404"
                subTitle="抱歉，您访问的管理页面不存在"
                extra={[
                    <Button 
                        type="primary" 
                        key="dashboard"
                        icon={<HomeOutlined />}
                        onClick={handleBackToDashboard}
                    >
                        返回管理仪表盘
                    </Button>,
                    <Button 
                        key="login"
                        icon={<LoginOutlined />}
                        onClick={handleBackToLogin}
                    >
                        返回管理员登录
                    </Button>
                ]}
            />
        </div>
    )
}
